
import 'package:flutter/cupertino.dart';
import 'package:yb_zsyiji_androidflutter_pro/YBHelper/YBColor/YBColor.dart';

class YBRefreshScrollBehavior extends ScrollBehavior {

  @override
  Widget buildViewportChrome(BuildContext context,Widget child, AxisDirection axisDirection){
    switch (getPlatform(context)){
      case TargetPlatform.iOS:
        return child;
      case TargetPlatform.macOS:
      case TargetPlatform.android:
       return GlowingOverscrollIndicator(
           axisDirection: axisDirection,
           showLeading: true,
           showTrailing: true,
           child: child,
           notificationPredicate: (notification){
             if (notification.depth == 0){
               if (notification.metrics.outOfRange) {
                 return false;
               }
               return true;
             }
             return true;
           },
           color: YBColor.commonThemeColor
       );
      case TargetPlatform.fuchsia:
      case TargetPlatform.linux:
      case TargetPlatform.windows:
    }
  }

}